<%@ page language="java" contentType="text/html; charset=UTF-8"    pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="sec"    uri="http://www.springframework.org/security/tags"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
<sec:authentication property="principal" var="currentPrincipal" scope="page" />

<fmt:setBundle basename="ApplicationMessage" />
<fmt:setLocale value="zh_CN" />

<!DOCTYPE html>
<html lang="zh-CN">
<head>

  <%@ include file="/WEB-INF/include/meta.jsp"%>
  <%@ include file="/WEB-INF/include/css.jsp"%>

</head>

<body class="ms-theme-blue">

  <%@ include file="/WEB-INF/include/header.jsp"%>
  <%@ include file="/WEB-INF/include/submenu.jsp"%>
  
  <div class="container-fluid ms-container has-ms-sidemenu">
    
    <ol class="ms-breadcrumb breadcrumb">
      <c:choose>
        <c:when test="${target eq 'search'}">
		      <li class="active">外包调度指令&nbsp;-&nbsp;查询</li>
        </c:when>
        <c:when test="${target eq 'dispatch'}">
          <li class="active">生效外包调度指令&nbsp;-&nbsp;派车</li>
        </c:when>
        <c:when test="${target eq 'maintain'}">
          <li class="active">外包调度指令&nbsp;-&nbsp;维护</li>
        </c:when>
      </c:choose>
    </ol>
    
    <div class="ms-content-layout">
    
      <form class="form-horizontal ms-form form-personal-info" method="GET" action="${ctx.host}/out-shipments" data-validate="true">
      
        <input type="hidden" name="filter" value="true" />
        <input type="hidden" name="target" value="${target}" />
        
        <jsp:include page="/WEB-INF/jsps/business/select-company.jsp">
          <jsp:param value="true" name="multiple"/>
        </jsp:include>
        
        <div class="form-group ms-form-group">
          <label class="col-xs-2 control-label">安吉调度指令号：</label>
          <div class="col-xs-3">
             <input type="text" name="shipmentNumber" class="form-control" placeholder="安吉调度指令号" tabindex="2">
          </div>
          <label class="col-xs-2 control-label">驳运车号：</label>
            <div class="col-xs-3 modal-search-warp">
              <input type="text" class="form-control vehicle-search modal-search"
                                 data-org="" data-value-name="transMeansId" placeholder="请填写驳运车号"
                                 data-modal-search="#modal-search-vehicle" tabindex="3">
              <a href="javascript:void(0);" class="btn" data-koala-search="true"
                 data-target="#modal-search-vehicle" data-toggle="modal">
                  <span class="glyphicon glyphicon-align-justify" aria-hidden="true"></span>
              </a>
            </div>
         </div>
        
         <div class="form-group ms-form-group">
          <label class="col-xs-2 control-label">起始地：</label>
          <div class="col-xs-3 modal-search-warp">
            <input type="text" class="form-control fromWarehouse-search modal-search" 
                               data-value-name="srcWhId" placeholder="请填写起始地"
                               data-modal-search="#modal-search-fromWarehouse" tabindex="4">
            <a href="javascript:void(0);" class="btn" data-target="#modal-search-fromWarehouse" data-toggle="modal">
              <span class="glyphicon glyphicon-align-justify" aria-hidden="true"></span>
            </a>
          </div>
          <label class="col-xs-2 control-label">目的地：</label>
           <div class="col-xs-3 modal-search-warp">
            <input type="text" class="form-control toWarehouse-search modal-search" 
                               data-value-name="destWhId" placeholder="请填写目的地"
                               data-modal-search="#modal-search-toWarehouse" tabindex="5">
            <a href="javascript:void(0);" class="btn" data-target="#modal-search-toWarehouse" data-toggle="modal">
              <span class="glyphicon glyphicon-align-justify" aria-hidden="true"></span>
            </a>
          </div>
        </div>
        
        <div class="form-group ms-form-group">
          <label class="col-xs-2 control-label">承运方：</label>
          <div class="col-xs-3 modal-search-warp">
            <input type="text" class="form-control company-search modal-search" 
                               data-value-name="transCorpId" placeholder="请填写承运方"  
                               data-modal-search="#modal-search-company" tabindex="6">
            <a href="javascript:void(0);" class="btn" data-target="#modal-search-company" data-toggle="modal">
              <span class="glyphicon glyphicon-align-justify" aria-hidden="true"></span>
            </a>
          </div>
        </div>
        
        <div class="form-group ms-form-group">
          <label class="col-xs-2 control-label">日期：</label>
           <div class="col-xs-8 common-date">
            <input type="text" name="beginShipmentDate" class="form-control date" placeholder="请填写开始日期" tabindex="7" autocomplete="off">
            <label class="control-label">到：</label>
            <input type="text" name="endShipmentDate" class="form-control date" placeholder="请填写结束日期" tabindex="8" autocomplete="off">
          </div>
        </div>
        
        <div class="form-group ms-form-group">
          <label class="col-xs-2 control-label">预计装运日期：</label>
          <div class="col-xs-8 common-date">
            <input type="text" name="beginLoadingTime" class="form-control date" placeholder="请填写开始装运时间" tabindex="9" autocomplete="off">
            <label class="control-label">到：</label>
            <input type="text" name="endLoadingTime" class="form-control date" placeholder="请填写结束装运时间" tabindex="10" autocomplete="off">
          </div>
        </div>
        
        <div class="form-group ms-form-group">
          <label class="col-xs-2 control-label">预计起运日期：</label>
          <div class="col-xs-8 common-date">
            <input type="text" name="beginLeavingTime" class="form-control date" placeholder="请填写开始起运时间" tabindex="11" autocomplete="off">
        	  <label class="control-label">到：</label>
            <input type="text" name="endLeavingTime" class="form-control date" placeholder="请填写结束起运时间" tabindex="12" autocomplete="off">
          </div>
        </div> 

        <c:choose>
	        <c:when test="${target eq 'search'}">
	          <div class="form-group ms-form-group">
	            <label class="col-xs-2 control-label">调度指令状态：</label>
	            <div class="col-xs-3">
	               <select class="select2 form-control" name="status" tabindex="13">
	                 <option ></option>
	                 <c:forEach items="${selection.shipmentStatus}" var="status">
	                    <option value="${status.code}">${status.value}</option>
	                 </c:forEach>
	              </select>
	            </div>
	          </div>
	        </c:when>
	        <c:when test="${target eq 'dispatch'}">
	          <input type="hidden" name="status" value="1" />
	        </c:when>
	        <c:when test="${target eq 'maintain'}">
	          <input type="hidden" name="status" value="2" />
	        </c:when>
        </c:choose>        

        <div class="form-group ms-form-group">
        	<div class="col-xs-6 col-xs-offset-3 ms-operation-group top-margin-20 text-center">
            <div class="col-xs-5">
              <button type="reset" class="btn btn-block btn-default btn-remove">重置</button>
            </div>
            <div class="col-xs-5">
              <button type="submit" class="btn btn-block btn-primary" tabindex="14">查询</button>
            </div>
        	</div>
        </div>

      </form>

    </div> 
  </div>       
  <%@ include file="/WEB-INF/include/script.jsp"%>
  <d:resource type="script" root="${ctx.resource}/build" src="js/page/business/out-shipment/out-shipment-search.js" />
  <script type="text/javascript">
      require(['page/business/out-shipment/out-shipment-search'], function(page) {
        page.init()
      })
  </script>

</body>
</html>